package org.example;

/**
 * 策略枚举
 */
public enum PaymentStrategy {
    CREDIT_CARD{
        @Override
        public void pay(double amount){
            System.out.println("支付方式：信用卡，支付金额："+amount);
        }
    },
    PAYPAL{
        @Override
        public void pay(double amount){
            System.out.println("支付方式：PayPal，支付金额：" + amount);
        }
    },
    BANK_TRANSFER {
        @Override
        public void pay(double amount) {
            System.out.println("支付方式：银行转账，支付金额：" + amount);
        }
    };

    //抽象支付方法
    public abstract void pay(double amount);
}
